package com.obj.testReflect;

import cn.hutool.core.util.ReflectUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author keyer
 * @Description : 描述
 * Created by cyd on 2021-04-16 14:33:41
 */
public class TestReflectUtil {
    public static void main(String[] args) {
        Person zhangsan = new Person("zhangsan", 20);
        ReflectUtil.setFieldValue(zhangsan, "name2", "lisi");
        System.out.println(zhangsan);
    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
class Person {
    String name;
    Integer age;
}
